package com.lzh.blog.service.Impl;

import com.lzh.blog.dao.UserRepository;
import com.lzh.blog.pojo.User;
import com.lzh.blog.service.UserService;
import com.lzh.blog.util.MD5Utils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @author liuzhihao
 * @create 2021-09-25 14:08
 */
@Service
public class UserServiceImpl implements UserService {

    @Autowired
    private UserRepository userRepository;

    @Override
    public User checkUser(String username, String password) {
        User user = userRepository.findByUsernameAndPassword(username, MD5Utils.code(password));
        return user;
    }

}
